<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		//window 加载完毕才执行
		window.onload = function  () {
			
			box = document.getElementById('box');

			console.log(box);

			// box.style.backgroundColor='red';
			// 
			a = document.getElementsByTagName('a');

			console.log(a);

			// a[0].style.fontSize='20px';
			// 
			box1 = document.getElementsByClassName('box1');

			box1[0].style.backgroundColor='red';
			box1[1].style.marginLeft='100px';

			console.log(box1);



			box.onclick = function () {
				// 触发事件执行代码
				box.style.height='200px';
			}

			box.onmouseover = function () {
				box.style.backgroundColor='red';
			}


			input = document.getElementsByTagName('input');


			input[0].onfocus = function  () {
				// alert(888)
			}

			input[0].onblur = function  () {
				// alert(888)
			}


			input[0].onchange = function  () {
				
			}



			box = document.getElementById('box');
			box2 = document.getElementById('box2');

			// content = box.innerHTML;

			// text = box.textContent;

			// alert(text);





			// box2.innerHTML=content;
			// 
			baidu = document.getElementById("baidu");

			// baidu.href="http://www.163.com"
			// 
			// bb =  baidu.getAttribute('xbs');

			// baidu.setAttribute('class','box')



			baidu.style.backgroundColor='red';

			// height = baidu.style.height;

			// alert(height)

			// height = parseInt(height)*2;

			// baidu.style.height = height+"px";
			// 
			// 
			height = window.getComputedStyle ? window.getComputedStyle(baidu,null).height : baidu.currentStyle.height;

			alert(height);








		}
	</script>
</head>
<body>
	<p id="box"><span>学并思</span></p>
	<a href="">这个是一个a1</a>
	<a href="">这个是一个a2</a>
	<span class='box1'>这个是小span</span>
	<span class='box1'>这个是小span</span>

	<input  type="text" >
	<div id="box2" style="background-color:blue;height:100px;"></div>

	<a id="baidu"  name="xbs"  xbs='学并思' href="http://www.baidu.com">百度</a>

	<style type="text/css">
		#baidu{
			display: block;
			height: 288px;
		}

	</style>
</body>
</html>